<!DOCTYPE html>
<html lang="en">
<head>
   	 	<meta charset="UTF-8">
	    <title></title>
	    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
		<script type="text/javascript">
		    var path = "${path}";
	 	</script>  
		<script src="${resources}/plugins/jquery/2.2.2/jquery.min.js" type="text/javascript" ></script>
		<script src="${resources}/plugins/wechat/jweixin-1.0.0.js"></script>
		<script src="${resources}/plugins/wechat/wechat.js"></script>
		<script type="text/javascript">
			var corpid = '${corpid}';
		    var appid = '${appid}';
		    var scopeEnum = 2;		//1表示静默 2授权
			//微信浏览器登陆 
			if(isWeixin()){
				
				getUserInfoByAuthorization(corpid,appid,scopeEnum,function(data){
					//获取用户信息
					var userinfo =data.result;
					var openid = userinfo.openid;
					var headimgurl = userinfo.headimgurl;
					var nickname = userinfo.nickname;
					//debugger;
					//nickname = encodeURI(encodeURI(nickname));

					//解决android返回时openid为undefined的问题
		    		if (typeof(openid) == "undefined") { 
		    			var url = '${path}'+'${returnURL}';
		    			window.location.replace(url);
		    			return;
		    		}
					//注册，或session持久用户登录状态
					$.ajax({
						type:"post",
						url:"${path}/sessionInject/memberid",
						data:{
							openid:openid,
							headimgurl:headimgurl,
							nickname:nickname
						},
						success:function(data){
							//跳转
							var url = '${path}'+'${returnURL}';
							window.location.replace(url);
						}
					})			
				
					
				});
		    }
		</script>
		
	</head>
	
	<body>
		<div id="loading" style="position:fixed;width:100%;height:100%;top:30%;left:0;backgroun-color:#fff;z-index:9999">
			<div style="display:block;text-align:center;margin-bottom:10px;"><img src="${resources}/images/loading2.gif" ></div>
			<div style="display:block;text-align:center;font-size:13px;font-weight:bolder;color:#333;">页面正在加载中...</div>
		</div>
	</body>
</html>